package com.example.wechat;

import android.app.Activity;
import android.os.Bundle;
import android.text.TextUtils;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

public class PayActivity extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_pay);

        EditText etAmount = findViewById(R.id.et_amount);
        Button btnPay = findViewById(R.id.btn_pay);
        TextView tvResult = findViewById(R.id.tv_result);

        btnPay.setOnClickListener(v -> {
            String amount = etAmount.getText().toString().trim();
            if (TextUtils.isEmpty(amount)) {
                Toast.makeText(this, "请输入金额", Toast.LENGTH_SHORT).show();
                return;
            }
            tvResult.setText("支付成功，金额：" + amount + " 元");
        });
    }
} 